package config;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.io.Serializable;
import java.io.StringReader;
import java.util.List;

public class ConfigReader implements Serializable {
    public static void redConfig()throws Exception{
        //XML读取器
        SAXReader reader=new SAXReader();
        Document doc=  reader.read("config/cfg.xml");
        Element game=doc.getRootElement();
        Element frame=game.element("frame");
        List<Element> layers = frame.elements("layer");
        for (Element layer:layers){
            System.out.println(layer.attribute("className"));
        }

    }
    public static void main(String[] args)throws Exception{
        redConfig();
    }
}
